<%@ include file="/WEB-INF/jsp/includes.jsp" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %>
<c:choose>
	<c:when test="${album.new}"><c:set var="method" value="post"/></c:when>
	<c:otherwise><c:set var="method" value="put"/></c:otherwise>
</c:choose>

<h2><c:if test="${album.new}">New </c:if>Album:</h2>
<form:form modelAttribute="album" method="${method}">
  <table>
    <tr>
      <th>
        Name: <form:errors path="name" cssClass="errors"/>
        <br/>
        <form:input path="name" size="30" maxlength="80"/>
      </th>
    </tr>
    <tr>
      <th>
        Creation Date: <form:errors path="creationDate" cssClass="errors"/>
        <br/>
        <form:input path="creationDate" size="10" maxlength="10"/> (yyyy-MM-dd)
      </th>
    </tr>
    <tr>
      <th>
        Modify Date: <form:errors path="modifyDate" cssClass="errors"/>
        <br/>
        <form:input path="modifyDate" size="10" maxlength="10"/> (yyyy-MM-dd)
      </th>
    </tr>
    <tr>
      <th>
        Publish Date: <form:errors path="publishDate" cssClass="errors"/>
        <br/>
        <form:input path="publishDate" size="10" maxlength="10"/> (yyyy-MM-dd)
      </th>
    </tr>
    <tr>
      <th>
        Public: <form:errors path="isPublic" cssClass="errors"/>
        <br/>
        <form:checkbox path="isPublic"/>
      </th>
    </tr>
    <tr>
      <td>
        <c:choose>
          <c:when test="${album.new}">
            <p class="submit"><input type="submit" value="Add Album"/></p>
          </c:when>
          <c:otherwise>
            <p class="submit"><input type="submit" value="Update Album"/></p>
          </c:otherwise>
        </c:choose>
      </td>
    </tr>
  </table>
</form:form>

<%@ include file="/WEB-INF/jsp/footer.jsp" %>
